<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变量</title>
    <script>
        //定义变量
        var a = "Gnar";

        //定义number类型的
        var num = 1;
        var num2 = 6.6;
        var num3 = NaN;
        document.write(num + "---" + typeof(num) + "<br>");
        document.write(num2 + "<br>");
        document.write(num3 + "<br>");

        //定义字符串类型的
        var str = "Gnar";
        var str2 = 'Neeko';
        document.write(str + "---" + typeof(str) + "<br>");
        document.write(str2 + "<br>");

        //定义布尔类型
        var flag = true;
        document.write(flag + "---" + typeof(flag) + "<br>");

        //定义null,undefined
        var obj = null;
        var obj2 = undefined;
        document.write(obj + "---" + typeof(obj) + "<br>");
        document.write(obj2 + "<br>");


    </script>
</head>
<body>

</body>
</html>